<?php
include_once('page_global.php');
if($conf->Get_value('enable_signup')!='checked')
bn_redirect('../error.php');
bn_include_lib('bn_jquery');
$lan=new bn_lang;
$theme->add_block('body');
$theme->add_script(jquery_submit_show('#submit','signup','#signup_div'));
$cmd=$_POST['cmd'];
if(isset($cmd))
{
    $usr=new bn_user();
    extract($_POST);
    if($pass!=$repass)
    die($lang[9]);
    if(strlen($pass)<5)
    die($lang[10]);
    $code=$usr->insert($user,$pass,$rol,'','',$lang);
    if($code==1)
    die($lang[12].$user.$lang[13]);
    else
    die($lang[11].$code);
}
?>
<table id="signup_div">
<tr>
	<td><?= $lang[3]  ?></td>
	<td><input type="text" size="30" name="user" id="user" class="input-text"/></td>
</tr>
<tr>
	<td><?= $lang[4]  ?></td>
	<td><input type="password" size="30" name="pass" id="pass" class="input-text"/></td>
</tr>
<tr>
	<td><?= $lang[14]  ?></td>
	<td><input type="password" size="30" name="repass" id="repass" class="input-text"/></td>
</tr>
<tr>
	<td><?= $lang[15]  ?></td>
	<td><input type="text" size="30" name="mail" id="mail" class="input-text"/></td>
</tr>
<tr>
	<td><?= $lang[8]  ?></td>
	<td><?= $lan->lang_list(array('name'=>'lang','cssclass'=>'select')) ?></td>
</tr>
<tr>
	<td colspan="2"><input type="submit" name="submit" id="submit" value="<?= $lang[1]  ?>" class="button"/></td>
</tr>
</table></form>
<?php
$theme->render();
?>